﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="RendicionVentaEditForm.aspx.cs" 
Inherits="UILGestion.VentaAdmin.RendicionVenta.RendicionVentaEditForm" %>

<%@ Register Assembly="WebLib" Namespace="WebLib" TagPrefix="lib" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<%@ Register src="../../Control/menuCtrl.ascx" tagname="menuCtrl" tagprefix="uc1" %>
<%@ Register src="RendicionVentaItemGrid.ascx" tagname="RendicionVentaItemGrid" tagprefix="uc2" %>





<%@ Register src="LiquidacionVentaGrid.ascx" tagname="LiquidacionVentaGrid" tagprefix="uc4" %>


<%@ Register src="PendientePagoPanel.ascx" tagname="PendientePagoPanel" tagprefix="uc3" %>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
 <link href="../../css/main.css" rel="stylesheet" type="text/css" />
 <link rel="stylesheet" type="text/css" href="../../estilos/_common/styles/fonts.css" />
 <link rel="stylesheet" type="text/css" href="../../estilos/_common/styles/global.css" />
 <link rel="stylesheet" type="text/css" href="../../estilos/_common/styles/theme.css" />
    <title>Rendicion Venta</title>
     <script src="../../Scripts/DocumentoVenta.js" type="text/javascript"></script>
    <style type="text/css">
        .style2
        {
            height: 17px;
        }
    </style>



    <script type="text/javascript">


        function validarCliente(inp) {

            var clienteid = inp.id;
            var idcliente1id = clienteid.replace("clienteTXT", "idClienteTXT");
            var cliente1id = clienteid.replace("clienteTXT", "cliente1TXT");
            var idcliente = document.getElementById(idcliente1id);
            var cliente1 = document.getElementById(cliente1id);

            if (idcliente.value != "") {

                inp.value = cliente1.value;

            } else {

                inp.focus();
            }

        }

        function SelectCliente(inp, data) {

            var cliente = inp.id;

            var idid = cliente.replace("clienteTXT", "idClienteTXT");
            var cliente1id = cliente.replace("clienteTXT", "cliente1TXT");
            //var direccionid = cliente.replace("clienteTXT", "direccionTXT");
            var docclienteLBLid = cliente.replace("clienteTXT", "docClienteTXT");
            var numDocClienteid = cliente.replace("clienteTXT", "numDocClienteTXT");


            var idcliente = document.getElementById(idid).value;
            

                document.getElementById(idid).value = data[0];
                document.getElementById(docclienteLBLid).value = data[8];
                document.getElementById(cliente1id).value = data[2];
                document.getElementById(inp.id).value = data[2];
                document.getElementById(numDocClienteid).value = data[1];
           
        }
    </script>
   
</head>
<body>
    <form id="form1" runat="server">
    <input id="type" type="hidden" runat="server" />
    <input id="internalID" type="hidden" runat="server" />
    <input id="idProyecto" type="hidden" runat="server" />
    <input id="paginaAnt" type="hidden" runat="server" />
    <input id="idOrdenVenta" type="hidden" runat="server" />
    <input id="idConcepto" type="hidden" runat="server" />
    <input id="idColeccion" type="hidden" runat="server" />
    
     <uc1:menuCtrl ID="menuCtrl1" runat="server" />
    
      <asp:ToolkitScriptManager ID="ToolkitScriptManager2" runat="server" 
      EnableScriptGlobalization="true"  EnablePartialRendering="true" />
    
     <asp:Panel ID="pnlMain" runat="server"
  CssClass="Heading secTitle AreaHeading ms-crm-List-Header">
  <asp:Label ID="Label2" runat="server" Text="NUEVO PAGO" 
             style="font-size: large; color: #960818"></asp:Label>
 </asp:Panel>

          <asp:Panel ID="PanelButtom" runat="server"     class="ms-crm-Form-Body" >                 
   <table >
<tr>

<td>
    <asp:Button ID="saveBTN" runat="server" Text="Guardar"   OnClientClick="return confirm('Usted quiere guardar la Rendicion Deposito?')"   
       OnClick="button"   CssClass="ms-crm-List-Header"    /></td>
<td>
    <asp:Button ID="cancelarBTN" runat="server" Text="Cancelar"  
       OnClick="button" CssClass="ms-crm-List-Header"  /></td>
        <td></td>
        <td>
    <asp:Button ID="refreshBTN" runat="server" Text="Restablecer"   OnClick="button" CssClass="ms-crm-List-Header" 
          /></td> 
 
</tr>
</table>
</asp:Panel>

<asp:Panel ID="PanelBody" runat="server"  BackColor="white" >



              <asp:UpdatePanel runat="server" ID="cabUPNL" UpdateMode="Conditional">
              <ContentTemplate>
              
          
                <table>
                   
                    <tr>
                        <td rowspan="7" valign="top"  Width="680px">
               
                                     <table>
                                         <tr>
                                             <td align="right" width="100px">
                                                 &nbsp;</td>
                                             <td width="280px">
                                                 &nbsp;</td>
                                             <td width="280px" align="right">
                                                 Usuario:</td>
                                             <td width="280px">
                                                 <asp:Label ID="usuarioLBL" runat="server" Text=""></asp:Label>
                                             </td>
                                         </tr>
                                         <tr>
                                                  <td align="right" width="100px">
                                                      Fecha:</td>
                                                  <td>
                                                      <asp:TextBox ID="fechaTXT" runat="server" Enabled="False" 
                                                          ontextchanged="fechaTXT_TextChanged" Width="70px"></asp:TextBox>
                                                      <asp:ImageButton ID="ImageButton3" runat="Server" 
                                                          AlternateText="Click aqui para mostrar calendario" Enabled="False" 
                                                          ImageUrl="~/Images/month.gif" Width="16px" />
                                                      <asp:CalendarExtender ID="CalendarExtender2" runat="server" 
                                                          PopupButtonID="ImageButton3" TargetControlID="FechaTXT"></asp:CalendarExtender>
                                                  </td>
                                                  <td align="right">
                                                      Moneda:</td>
                                                  <td>
                                                      <asp:DropDownList ID="monedaDDL" runat="server" Width="150px" Enabled="False">
                                                      </asp:DropDownList>
                                                  </td>
                                              </tr>
                                          <tr>
                                             <td align="right" width="150px">
                                                
                                                  Concepto:</td>
                                             <td width="280px">
                                                 <asp:DropDownList ID="conceptoDDL" runat="server" Enabled="False" Width="250px">
                                                 </asp:DropDownList>
                                              </td>
                                              <td width="280px" align="right">
                                                  Comentario:</td>
                                              <td rowspan="3" valign="top">
                                                  <asp:TextBox ID="comentarioTXT" runat="server" Height="50px" 
                                                      TextMode="MultiLine" Width="200px"></asp:TextBox>
                                              </td>
                                         </tr>
                                         <tr>
                                             <td align="right" width="100px">
                                                 &nbsp;</td>
                                             <td width="280px">
                                                 &nbsp;</td>
                                             <td width="280px" align="right">
                                                 &nbsp;</td>
                                         </tr>
                           
                                         <tr>
                                             <td align="right" width="100px">
                                                 Tipo Cambio $:</td>
                                             <td>
                                              <asp:UpdatePanel runat="server" ID="tipoCambioUPNL" UpdateMode="Conditional">
                                              <ContentTemplate>
<asp:Label ID="tipoCambioLBL" runat="server" Text=""></asp:Label>
                                              </ContentTemplate>
                                              
                                             </asp:UpdatePanel>
                                                 
                                             </td>
                                             <td align="right">
                                                 &nbsp;</td>
                                         </tr>
                           
                        </table>
               
                        </td>
                    </tr>
                  
               
                    <tr class="PanelTotales">
                        
                        <td> <table  class="PanelTotales" >
      
      <tr>
      <td  align="right" class="style2" >Total Documento:</td>
      <td align="right" class="style2" width="150PX"  >
          <asp:Label ID="totalDocumentoLBL" runat="server"></asp:Label>
          </td>
       
          <tr>
              <td align="right" class="style2" >
                   
                  Total Deposito: </td>
              <td align="right" valign="100px" class="style2" width="150PX">
                  <asp:Label ID="totalDepositoLBL" runat="server"></asp:Label>
                  <br />
                  
                  
              </td>
          </tr>
          <tr>
              <td align="right" class="style2" >
                   Diferencia: </td>
              <td align="right" valign="100px" class="style2" width="150PX">
                  <asp:Label ID="totalDiferenciaLBL" runat="server"></asp:Label>
              </td>
          </tr>
          
       
      </tr>
      </table></td>
                    </tr>
                   
                </table>

            </ContentTemplate>
              </asp:UpdatePanel>
 
  
      <asp:TabContainer ID="TabContainer1" runat="server"  ActiveTabIndex="0"  
          Width="100%" ><asp:TabPanel ID="TabPanel1" runat="server" HeaderText="Conceptos" ><ContentTemplate><asp:Button ID="AddDocumentoVenta" runat="server" CssClass="ms-crm-List-Header" 
                      OnClick="button" Text="Agregar Documento" /><asp:LinkButton ID="LinkButton1" runat="server"></asp:LinkButton><asp:modalpopupextender ID="AddDocumentoVentaModal" runat="server" 
                      BackgroundCssClass="modalBackground" CancelControlID="cancelarAddButton" 
                      dropshadow="True" DynamicServicePath="" Enabled="True" 
                      popupcontrolid="AddDocumentoVentaParentPanel" 
                      popupdraghandlecontrolid="AddDocumentoVentaParent" RepositionMode="None" 
                      targetcontrolid="LinkButton1" X="0" Y="0" /><asp:UpdatePanel ID="itemUpdatePanel" runat="server" UpdateMode="Conditional"><ContentTemplate><uc2:RendicionVentaItemGrid ID="rendicionVentaItemGrid1" runat="server" /></ContentTemplate></asp:UpdatePanel></ContentTemplate></asp:TabPanel><asp:TabPanel ID="TabPanel2" runat="server" HeaderText="Liquidacion" ><ContentTemplate><uc4:LiquidacionVentaGrid ID="LiquidacionVentaGrid1" runat="server" />&#160;&#160;<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional"><ContentTemplate></ContentTemplate></asp:UpdatePanel></ContentTemplate></asp:TabPanel></asp:TabContainer>
      
      

 
 </asp:Panel>
   



   

      <asp:Panel ID="AddDocumentoVentaParentPanel" runat="server"   CssClass="modalPopup">
  <asp:Panel ID="AddDocumentoVentaParent"   runat="server"    
  BorderColor="LightBlue"  BorderStyle="Solid" Style="background-color:#DDDDDD;border:solid 1px Gray;color:Black">
              
 

        <asp:Panel ID="Panel17" runat="server"   >
        
<table width="100%" >
 <tr  >
               
                <td class=" ms-crm-Dialog-Footer-Right">
               
                    <asp:Button ID="AddPendienteVentaButton"  runat="server"  Text="Agregar Documento"
                      CssClass="ms-crm-List-Header"  onclick="button"
                          OnClientClick="return confirm('Seguro que desea Agregar los Documentos?')" 
                    />
                  
                    <asp:Button ID="cancelarAddButton"  runat="server" Text="Cancelar" CssClass="ms-crm-List-Header"
                       />
                   
                </td>
   </tr>


   
</table>
        </asp:Panel> 
 <asp:Panel ID="Panel6" runat="server"  
          class="ms-crm-Dialog-Footer ms-crm-Dialog-Footer-Right">








             


                                         

             <table  width="100%">
          <tr>
              <td Width="800px">
              <asp:Panel ID="PanelwButtom" runat="server"   BackColor="white"  GroupingText="Filtros de busqueda">

                <table class="ui-accordion" style="background-color:White">


  <tr>
                                                  <td align="right" width="100px">
                                                      ID:</td>
                                                  <td width="350px" >
                                                      &nbsp;<lib:Input ID="idClienteTXT" runat="server" BackColor="Transparent" 
                                                          ReadOnly="true" Width="35px"></lib:Input>
                                                  </td>
                                                  <td align="right">
                                                      Concepto:</td>
                                                  <td>
                                                      <asp:DropDownList ID="conceptoSelDDL" runat="server" Width="250px">
                                                      </asp:DropDownList>
                                                  </td>
                                              </tr>
  <tr>
                                             <td align="right" width="100px">
                                                
                                                  Cliente:</td>
                                             <td width="350px" >
                                                 <lib:Input ID="clienteTXT" runat="server" AutoPostBack="true" 
                                                     backcolor="#DFE8F6" DataType="List" method="GetCliente" NumColum="9" 
                                                     onchange="javascript:validarCliente(this);" OnSelect="SelectCliente" 
                                                     Width="250px"></lib:Input>
                                             </td>
                                             <td align="right">
                                                 Moneda:</td>
                                             <td>
                                                 <asp:Label ID="monedaselDDL" runat="server"></asp:Label>
                                             </td>
                                         </tr>
    <tr>
                                             <td align="right" width="100px">
                                                
                                                      Nombre:</td>
                                             <td width="350px" >
                                                      <lib:Input ID="clienteTXT0" runat="server" AutoPostBack="true" 
                                                          backcolor="#DFE8F6"  NumColum="9" 
                                                          Width="250px"></lib:Input>
                                             </td>
                                             <td>
                                                 &nbsp;</td>
                                             <td>
                                                 &nbsp;</td>
                                         </tr>

         
                                         </table>
 </asp:Panel>
 </td>
      <td>
                  &nbsp;</td>
          </tr>
      </table>


      <asp:UpdatePanel ID="PendientePagoUpdatePanel" runat="server" UpdateMode="Conditional">
      <ContentTemplate>

  

  <uc3:PendientePagoPanel ID="PendientePagoPanel2" runat="server" DataSourceID="PendientePagoPanelODS" />
     
        <asp:ObjectDataSource ID="PendientePagoPanelODS" runat="server" EnablePaging="True" 
        SelectCountMethod="Count" SelectMethod="Execute" 
        SortParameterName="sortExpression"
        TypeName="BOL.Ventas.GetPendientePagoList">
        <SelectParameters>
             <asp:ControlParameter Name="idConcepto" Type="Int32" ControlID="conceptoDDL"/>
             <asp:ControlParameter Name="idMoneda" Type="Int32" ControlID="monedaDDL"/>
             <asp:ControlParameter Name="idCliente" Type="Int32" ControlID="idClienteTXT"/>
             <asp:QueryStringParameter Name="idProyecto" QueryStringField="idProyecto"  Type="Int32" />
             <asp:Parameter Name="startRowIndex" Type="Int32" />
             <asp:Parameter Name="maximumRows" Type="Int32" />
             <asp:Parameter Name="sortExpression" Type="String" />
        </SelectParameters>
    </asp:ObjectDataSource>
  </ContentTemplate>
      <Triggers>
<asp:AsyncPostBackTrigger ControlID="TabContainer1$TabPanel1$AddDocumentoVenta" />
<asp:AsyncPostBackTrigger ControlID="cancelarAddButton" />
<asp:AsyncPostBackTrigger ControlID="clienteTXT" />


</Triggers>


      
      </asp:UpdatePanel>

       
  
               
           </asp:Panel>






        </asp:Panel>
          </asp:Panel>
      

   
    
   
    </form>
    </body>
</html>
